#!/bin/sh -e
git clean -df
git pull

srcdir="/var/source/scheduletask"
slnfile=$srcdir/src/ScheduleTask/ScheduleTask.sln
csprojfile=$srcdir/src/ScheduleTask/ScheduleTask/ScheduleTask.csproj
pubpath=/var/pubsite/ScheduleTask/
daemonid=qin-ScheduleTask

dotnet restore $slnfile
dotnet build $slnfile
#cd $srcdir/src/SanWeb/SanWeb && npm install && bower install --allow-root && gulp default

systemctl stop $daemonid
rm -rf $pubpath
dotnet publish $csprojfile -c "Release" -o $pubpath
systemctl start $daemonid
